In a read-modify-write (RMW) operation of a memory, data from a memory address may be read, modified, and then written back to the address from which the data was read. An RMW operation may be an example of an atomic operation, e.g., in which the read, modify, and write operations are performed sequentially, and in which one or more other processes may not know about the changes being made by the RMW operation until the entire operation is completed. The modification operation of a RMW operation may modify data read from a memory address in a number of ways. For example, in a fetch and add operation, data from the memory address may be read, a given value may be added to the data (e.g., through a 1's complement addition, a 2's complement addition, or the like), and the modified data may be written back to the memory address. Numerous other types of RMW operations may also be possible.
In various applications, it may be desirable to perform two consecutive RMW operations on a same memory address. For example, a first RMW operation may commence after completion of a previous (e.g., second) RMW command. However, there may be instances where a command for the first RMW operation is received before completion of the previous (e.g., second) RMW operation. It may not always be possible to delay first RMW operation so that the first RMW operation starts after completion of the second RMW operation. In other instances, commands for the first and second RMW operations may be received substantially at same time (e.g., during same clock periods). However, partial overlapping of two RMW operations may result in failure of at least one of the RMW operations.